chore(port): forward-port v5-next pxe/client/txe backlog to next#24932
Merged
Conversation
While trying to deploy the latest nightly standard contracts to testnet I experienced gas estimation issues. According to Claude these issues are due to variability in Merkle tree insertions: there's around 40% of gas cost spread between the happiest case (no tree "climbing" needed) and the worst case (10 level climb). If eth_estimateGas occurs during the happiest case, and actual TX execution during the worst case, the default 20% buffer we use in Aztec.js turns out not to be sufficient. Closes F-794 (cherry picked from commit 2734da1)
First part of integrating the enhancements explored at aztec-labs-eng/oxide#257 Closes F-808 (cherry picked from commit 8a3f7e6)
Some stores were being accessed without checking if the associated accounts were in scope or not. For logs I added this to the service, but we're not yet consistent in how we use services (call-lived, tx-lived?) so in other cases it is just inlined in the oracle. (cherry picked from commit ce12e29)
Additions to the README on gas and fees (cherry picked from commit 4d53a9f)
…evidence (#24655) Fixes the sender tag sync conflict from https://gist.github.com/nventuro/0aa690736b1d2865e27197723a814e9d, including the "Window straddle" residual edge. Discovery could re-derive a different index range for an already tracked (secret, txHash) pair and hit the `Conflicting range` throw in `storePendingIndexes`, permanently wedging the secret. Two triggers: - A same-PXE tx partially reverts: the chain only shows the surviving non-revertible sub-range of the prove-time entry, and the throw fired before the finalized receipt step could resolve it. - A tx straddles a sync window boundary: the window loop assembles its range piecewise, so window 2 stores a different range than window 1 (latent regardless of reverts). Fix: discovery passes `mergeExisting` to `storePendingIndexes`, which widens the stored entry to the union of both ranges (grow-only, driven by onchain evidence). The finalized receipt step still resolves partial reverts. The only other writer of pending ranges, `persistSenderTaggingIndexRangesForTx` (records the indexes a tx sent from this PXE used, at prove time), does not pass the flag and still throws on a mismatch: there it indicates a bug, not partial onchain evidence. Red-green (all fail on the base with the `Conflicting range` throw): - partial revert repro: finalizes the surviving index, frees the squashed ones, repeat sync is a no-op - cross-sync widen: an entry tracked from an earlier sync grows when discovery evidences further indexes - window straddle: drives the actual window advance loop, asserts per window queried tags and that the widened entry later finalizes cleanly Store-level tests pin the union semantics: a sub-range keeps the entry, a range beyond it widens it, an untracked tx still stores. (cherry picked from commit fd7515d)
This fixes a scoping bug where an account's ivsk would be used to produce an ECDH shared secret even if that account was not in scope. The base wallet class was adjusted to put these in scope when an explicit sender is selected for tagged messages. (cherry picked from commit 4994006)
waitForNode called retryUntil without a timeout, and retryUntil treats a
zero timeout as the never-time-out sentinel, so an unreachable node caused
the call to poll getNodeInfo forever with no way for the caller to bound it.
Add an optional { timeout, interval } argument and default it to
DefaultWaitOpts (300s / 1s), matching the sibling waitForTx. An unreachable
node now rejects with a TimeoutError; pass timeout: 0 to opt into the
previous infinite-wait behavior.
(cherry picked from commit 482a6b8)
Fixes F-700 Fixes F-765 - makes TXE tagging secret strategy resolution mode-aware, matching PXE's resolveTaggingSecretStrategy hook request - supports configuring unconstrained and constrained delivery strategies independently in Noir tests - falls back to PXE's default strategy for unset modes, while preserving the no-hook path when no strategy is configured - adds coverage for resolved tagging strategy serialization/deserialization and per-mode TXE defaults - updates execution hook docs for the new Noir test helpers (cherry picked from commit 6dd1271)
) Fixes [F-680](https://linear.app/aztec-labs/issue/F-680/migrate-pxe-tagging-stores-to-prefixed-apptaggingsecret-keys) Migrates PXE tagging-store keys off the legacy two-part `AppTaggingSecret` string format (`secret:app`) so every persisted key uses the uniform self-describing `kind:secret:app` form. - `AppTaggingSecret.toString()` now always emits `kind:secret:app` (the unconstrained special case that emitted the legacy two-part key is gone). - `AppTaggingSecret.fromString()` only accepts the three-part form; a two-part legacy key now throws instead of parsing. - Bumped `PXE_DATA_SCHEMA_VERSION` 12 → 13. Since the general PXE migration framework does not exist, and per the issue discussion, this cuts over via the schema-version bump rather than a dual-read / self-healing path. `initStoreForRollupAndSchemaVersion` wipes any DB whose stored schema version differs from the current one on open, so a DB written with legacy keys is cleared before the new parser ever reads it. **Blast radius:** the wipe resets the *entire* PXE DB (addresses, notes, contracts, key store, L2 tips, facts, and tagging), not just tagging data, because they share one backing KV store. Existing wallets re-sync from genesis after upgrade. This is inherent to any `PXE_DATA_SCHEMA_VERSION` bump. - `app_tagging_secret.test.ts`: pins the new three-part unconstrained `toString()`, adds a "rejects the legacy two-part format" case, drops the now-redundant kind-prefixed-unconstrained test. - `pxe_db_compatibility.test.ts`: adds a pre-migration wipe test that writes a raw legacy two-part key at schema v12, reopens at v13, and asserts the raw map is empty (it asserts raw map contents rather than a high-level getter, which would false-pass since a new three-part `toString()` never reconstructs a legacy key). (cherry picked from commit 736f391)
Adds an oracle to check whether a collection of block hashes is present in the archiver tree as of a given block. An upstream port of: aztec-labs-eng/oxide#257 Note: I considered making this batch call return something more "interesting" than existence booleans (such as MembershipWitnesses), but that would potentially be heavy over the wire and there's no current evidence of it being needed. We can add a new oracle for that if turns out to be useful in the future. Closes F-810 (cherry picked from commit 2967179)
Adds a new `getTxEffects` oracle to fetch tx effects in batch. (cherry picked from commit 7a77232)
(cherry picked from commit 97b4c75)
nchamo
approved these changes
Jul 23, 2026
# Conflicts: # yarn-project/pxe/src/storage/backwards_compatibility_tests/pxe_db_compatibility.test.ts
nchamo
enabled auto-merge
July 23, 2026 19:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forward-ports the pxe / client / txe slice of the v5-next → next backlog (work merged to
v5-nextafter the ~2026-07-08 cut that reshapednext).Applied (clean cherry-picks, chronological)
Conflict resolutions (cherry-picked with
-x, resolved against reshapednext)setTaggingSecretStrategy->setTaggingSecretStrategies;nextwas at 3.0 with its own hash), interface hash recomputed on the merged registry. Migration note dropped: already onnextunder 5.0.0.PXE_DATA_SCHEMA_VERSION12 -> 13 applies cleanly onnext. Migration note dropped: already onnextunder 5.0.0.feat: preserve stores on schema version or rollup address change (feat: preserve stores on schema version or rollup address change #24631)— ported separately via chore: forward port sqlite changes #24947 together with the rest of the sqlite/OPFS lineVerified locally: full
yarn build,check_oracle_version+check_txe_oracle_version, TXE unit suite (21), pxe tagging/type-mapping/utility-oracle suites, and 29 targeted aztec-nr + onchain_delivery_test_contract TXE tests — all green.Part of the manual v5-next → next backlog sweep.
Added after review
(#N)leaf); genuinely absent fromnext.